package gameOnline.game;

/**
 * représente le jeu Pierre, feuille, ciseau
 * 
 * @author Amale El Bouffi
 */
public class PFC extends Game{
    
    private String rock = "Pierre";
    private String leaf = "Feuille";
    private String cisor = "Ciseaux";

    public PFC() {
        entries.addEntry(new EntryType(rock, "rock.jpg"));
        entries.addEntry(new EntryType(leaf, "leaf.jpg"));
        entries.addEntry(new EntryType(cisor, "cisor.jpg"));
    }

    @Override
    public ResultType getResult(EntryType entry, EntryType entryAdversary) {
        
        if (entry.getName().equals(entryAdversary.getName())) {
            return ResultType.EQUALITY;
        }
        if (entry.getName().equals(rock) && entryAdversary.getName().equals(cisor)
                || entry.getName().equals(cisor) && entryAdversary.getName().equals(leaf)
                || entry.getName().equals(leaf) && entryAdversary.getName().equals(rock)) {
            return ResultType.WIN;
        }
        return ResultType.LOOSE;
    }
}
